<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
//for stock
ini_set("display_errors",1);
error_reporting(E_ALL);

try {
    $url = "http://api.dddadmin.com/StockService.svc?wsdl";
    $client = new SoapClient($url);
    echo '<pre>';
	
	//var_dump($client->__getFunctions());
	
	$shopid = "855001";
	$myKey	= "vkal29xcjs81lslc8qlxpgg63anxaqk2ixkskxm19m";
	
	$params['clientid'] = "855001";
	$params['psk'] = "vkal29xcjs81lslc8qlxpgg63anxaqk2ixkskxm19m";
	
	
	$articles = $client->GetWebshopArticles($params);
	//var_dump($articles);
	$strInfo = ($articles->GetWebshopArticlesResult);
	$arrInfo = json_decode($strInfo);

	//file_put_contents('cache.txt', serialize($arrInfo));
	
	//echo "OK";
	
	$paramsstock['eans']	= array();
	$paramsstock['client']	= $shopid;
	$paramsstock['psk']		= $myKey;
	
	echo "<table border=\"1\">";
	echo "<th>KatalogNumber</th>";
	echo "<th>EdbNumber</th>";
	echo "<th>SupplierName</th>";
	echo "<th>ItemGroupName</th>";
	echo "<th>Ean</th>";
	echo "<th>Kparam1</th>";
	echo "<th>Vparam1</th>";
	echo "<th>Kparam2</th>";
	
	foreach($arrInfo as $key=>$value){
		
		$KatalogNumber 	= $value->KatalogNumber;
		$EdbNumber		= $value->EdbNumber;
		$SupplierName 	= $value->SupplierName;
		$ItemGroupName	= $value->ItemGroupName;
		$Supplier 		= $value->Supplier;
		$ItemGroup		= $value->ItemGroup;
		$Ean 			= $value->Ean;
		$Kparam1		= $value->Kparam1;
		$Kparam2 		= $value->Kparam2;
		$Kparam3		= $value->Kparam3;
		$Kparam4 		= $value->Kparam4;
		$Kparam5		= $value->Kparam5;
		$Vparam1 		= $value->Vparam1;
		$Vparam2		= $value->Vparam2;
		$Vparam3 		= $value->Vparam3;
		$Vparam4		= $value->Vparam4;
		$Vparam5 		= $value->Vparam5;
		$Qty			= $value->Qty;
		//$SalesPriceEach	= $value->SalesPriceEach;
		//$CostpriceEach	= $value->CostpriceEach;
		echo "<tr>";
		echo "<td>".$KatalogNumber."</td>";
		echo "<td>".$EdbNumber."</td>";
		echo "<td>".$SupplierName."</td>";
		echo "<td>".$ItemGroupName."</td>";
		echo "<td>".$Ean."</td>";
		echo "<td>".$Kparam1."</td>";
		echo "<td>".$Vparam1."</td>";
		echo "<td>".$Kparam2."</td>";
		
		echo "</tr>";
		
		
		
		
	}
	echo "</table>";
	
	
	echo '</pre>';
}
catch (SoapFault $exception) {
    echo $exception->getMessage();
}


?>
</body>
</html>